
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <div class="col-md-12">
        <form method="get" class="  form-horizontal " action="{:url('ajaxProduct')}?type=0">
            <div class="form-group">
            <div class="col-md-6">
                <input type="text" class="form-control " name="keyword" placeholder="请输入产品名称" value="{$keyword}" >
                <input type="submit" class="  btn btn-primary" value="搜索">
            </div>
            </div>
        </form>
    </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16">
                    <label>
                        <input type="checkbox" class=" js-check-all data-item-tr" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th>ID</th>
                <th>产品名称</th>
                <th>类型</th>
                <th>规格</th>
                <th>产品图</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="result" item="vo">
                <tr>
                    <td class="text-left">
                        <input type="checkbox" class="js-check "
                               data-pro_name="{$vo.pro_name}"
                               data-pro_type="{$vo.pro_type}"
                               data-pro_length="{$vo.pro_length}"
                               data-pro_width="{$vo.pro_width}"
                               data-pro_height="{$vo.pro_height}"
                               value="{$vo.id}"/>
                    </td>
                    <td>{$vo.id}</td>
                    <td>{$vo.pro_name}</td>
                    <td> <if condition="$vo.pro_type eq 1">商品墓
                        <elseif condition="$vo.pro_type eq 3"/>生态墓
                        <elseif condition="$vo.pro_type eq 4"/>壁葬<else/></if></td>
                    <td>{$vo.pro_length}mm*{$vo.pro_width}mm*{$vo.pro_height}mm</td>
                    <td>
                        <php>$img_url=cmf_get_image_preview_url($vo['pro_photo']);</php>
                        <img src="{$img_url}" id="thumb-preview" onclick="parent.imagePreviewDialog(this.src);"  width="50" style="cursor: hand"/>

                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
</div>
<script src="__STATIC__/js/admin.js?v={:time()}"></script>
<script>
    $('.data-item-tr').click(function (e) {
        var name = $(".js-check");
        for(var i=0;i<name.length;i++){
            if(name[i].checked)
                name[i].checked=false ;
            else
                name[i].checked=true ;
        }
    });

    function confirm() {
        var selectedProductId   = [];
        var selectedProductName = [];
        var productList     = [];
        $('.js-check:checked').each(function () {
            var $this = $(this);
            selectedProductId.push($this.val());
            selectedProductName.push($this.data('pro_name'));
            productList.push({
                pro_id: $this.val(),
                pro_name: $this.data('pro_name'),
                pro_type: $this.data('pro_type'),
                pro_length: $this.data('pro_length'),
                pro_width: $this.data('pro_width'),
                pro_height: $this.data('pro_height'),
            });
        });
        return {
            productList: productList,
            productId: selectedProductId,
            productName: selectedProductName
        };
    }
</script>

</div>
</body>
</html>





